﻿package Map {
	import flash.display.MovieClip;
	import Component.Map;
	import Component.Clock;
	import Component.MiniPlayer;
	
	public class MapScreen extends MovieClip {

		protected var _map:Map;
		protected var clock:Clock;
		
		private var minis:Vector.<MiniPlayer>;
		
		public function get map():Map {
			return _map;
		}

		public function MapScreen() {
			minis = new Vector.<MiniPlayer>();
		}
		
		public function addMini(player:MiniPlayer) {
			player.avatar.colorize(minis.length);
			minis.push(player);
		}
		
		public function new_round(){
			clock.reset(5*60);
			for each(var player:MiniPlayer in minis)
				player.reset();
		}
		
		public function playerDie(id:uint) {
			minis[id].die();
		}

	}
	
}
